package com.lsy.demo.impl;


import com.lsy.demo.mybatis.entity.MVCMybatisDemoUser;
import com.lsy.demo.mybatis.mapper.MVCMybatisDemoUserMapper;
import com.lsy.demo.GetUserInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.ui.Model;

import javax.annotation.Resource;



/*
 *
 * @author paida 派哒 zeyu.pzy@alibaba-inc.com
 * @date 2020/10/27
 */

@Service
public class GetUserInfoServiceImpl implements GetUserInfoService{

    private static final Logger logger = LoggerFactory.getLogger(GetUserInfoServiceImpl.class);

    @Autowired
    protected MVCMybatisDemoUserMapper mVCMybatisDemoUserMapper;

    @Override
    public void getUserInfoById(String id, Model model)
    {

        int m1 = 1,m2 =1;
        for (int i = 0; i <  100; i++) {
            m1 += i;
            m2 =+ i;
            logger.info("----------"+m1+"============="+m2);
            System.out.println(i);
        }
        // var javaString = 10;

        new Thread(()->{
            logger.info("09000000000000000000");
        },"线程的名称111").start();

        new Thread(()->{
            logger.info("线程2222222222222222");
        },"线程2的名称").start();


        logger.info("----走进方法------"+id);
        //search by id, get UserInfo
        MVCMybatisDemoUser user = mVCMybatisDemoUserMapper.queryUserInfo(id);
        model.addAttribute("name", user.getId())
                .addAttribute("age", user.getAge())
                .addAttribute("height", user.getHeight())
                .addAttribute("weight", user.getWeight());
    }
}
